#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDialog>
#include "dialog.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    dialog * d = new dialog(this);
    d->setAttribute(Qt::WA_DeleteOnClose);
    d->resize(400,200);

    //使用exec就是模态对话框,show就是非模态对话框
    d->exec();

}
